
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>国际化 · classbro-u-center-web-v2.0</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Gj">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-tomorrow.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../index.css">
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Interceptor.html" />
    
    
    <link rel="prev" href="Config.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    概要
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="Utils.html">
            
                <a href="Utils.html">
            
                    
                    工具集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="Config.html">
            
                <a href="Config.html">
            
                    
                    环境变量
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4" data-path="I18n.html">
            
                <a href="I18n.html">
            
                    
                    国际化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="Interceptor.html">
            
                <a href="Interceptor.html">
            
                    
                    拦截器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="Vuex.html">
            
                <a href="Vuex.html">
            
                    
                    Vuex
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="Api.html">
            
                <a href="Api.html">
            
                    
                    接口文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="Icon.html">
            
                <a href="Icon.html">
            
                    
                    图标
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="Xss.html">
            
                <a href="Xss.html">
            
                    
                    Xss
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="Permission.html">
            
                <a href="Permission.html">
            
                    
                    菜单&权限校验
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >国际化</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x56FD;&#x9645;&#x5316;">&#x56FD;&#x9645;&#x5316;</h1>
<blockquote>
<p>&#x76EE;&#x5F55;&#x5730;&#x5740;&#xFF1A;src/lang</p>
</blockquote>
<h4 id="&#x76EE;&#x5F55;&#x7ED3;&#x6784;">&#x76EE;&#x5F55;&#x7ED3;&#x6784;</h4>
<pre class="language-"><code class="lang-bash"><span class="token builtin class-name">.</span>
&#x251C;&#x2500;&#x2500; en.js
&#x251C;&#x2500;&#x2500; index.js
&#x251C;&#x2500;&#x2500; modules                <span class="token comment"># &#x53EA;&#x9700;&#x8981;&#x914D;&#x7F6E; &#x6B64;&#x76EE;&#x5F55;&#x4E0B;&#x6587;&#x4EF6;&#x5373;&#x53EF;</span>
&#x2502;   &#x251C;&#x2500;&#x2500; app.js
&#x2502;   &#x251C;&#x2500;&#x2500; login.js
&#x2502;   &#x251C;&#x2500;&#x2500; route.js
&#x2502;   &#x2514;&#x2500;&#x2500; userCenter.js
&#x251C;&#x2500;&#x2500; produce.js
&#x2514;&#x2500;&#x2500; zh.js
</code></pre>
<h4 id="&#x914D;&#x7F6E;">&#x914D;&#x7F6E;</h4>
<blockquote>
<p>&#x591A;&#x8BED;&#x8A00;&#x914D;&#x7F6E;&#x6A21;&#x5757;&#x5316;&#xFF0C;&#x6587;&#x4EF6;&#x540D;&#x9ED8;&#x8BA4;&#x4E3A;&#x8BF7;&#x6C42;&#x7684;<code>key</code>&#x503C;</p>
<p>src/lang/modules/app.js &#x4E3A;&#x4F8B;</p>
<p>&#x5BF9;&#x8C61;&#x540D;&#x5FC5;&#x987B;&#x4E3A; <code>zh</code>&#x3001;<code>en</code></p>
</blockquote>
<pre class="language-"><code class="lang-javascript"><span class="token comment">/* &#x5168;&#x5C40; &#x5E94;&#x7528; */</span>
<span class="token keyword">export</span> <span class="token keyword">const</span> zh <span class="token operator">=</span> <span class="token punctuation">{</span>
  size<span class="token operator">:</span> <span class="token string">&quot;&#x5E03;&#x5C40;&#x5927;&#x5C0F;&quot;</span><span class="token punctuation">,</span>
  signOut<span class="token operator">:</span> <span class="token punctuation">{</span>
    label<span class="token operator">:</span> <span class="token string">&quot;&#x9000;&#x51FA;&#x767B;&#x5F55;&quot;</span><span class="token punctuation">,</span>
    confirm<span class="token operator">:</span> <span class="token punctuation">{</span>
      tips<span class="token operator">:</span> <span class="token string">&quot;&#x63D0;&#x793A;&quot;</span><span class="token punctuation">,</span>
      label<span class="token operator">:</span> <span class="token string">&quot;&#x786E;&#x5B9A;&#x6CE8;&#x9500;&#x5E76;&#x9000;&#x51FA;&#x7CFB;&#x7EDF;&#x5417;&#xFF1F;&quot;</span><span class="token punctuation">,</span>
      ok<span class="token operator">:</span> <span class="token string">&quot;&#x786E;&#x5B9A;&quot;</span><span class="token punctuation">,</span>
      cancel<span class="token operator">:</span> <span class="token string">&quot;&#x53D6;&#x6D88;&quot;</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token keyword">export</span> <span class="token keyword">const</span> en <span class="token operator">=</span> <span class="token punctuation">{</span>
  size<span class="token operator">:</span> <span class="token string">&quot;Size&quot;</span><span class="token punctuation">,</span>
  signOut<span class="token operator">:</span> <span class="token punctuation">{</span>
    label<span class="token operator">:</span> <span class="token string">&quot;Sign out&quot;</span><span class="token punctuation">,</span>
    confirm<span class="token operator">:</span> <span class="token punctuation">{</span>
      tips<span class="token operator">:</span> <span class="token string">&quot;Tips&quot;</span><span class="token punctuation">,</span>
      label<span class="token operator">:</span> <span class="token string">&quot;Are you sure you want to log off and exit the system?&quot;</span><span class="token punctuation">,</span>
      ok<span class="token operator">:</span> <span class="token string">&quot;Ok&quot;</span><span class="token punctuation">,</span>
      cancel<span class="token operator">:</span> <span class="token string">&quot;Cancel&quot;</span><span class="token punctuation">,</span>
    <span class="token punctuation">}</span><span class="token punctuation">,</span>
  <span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
</code></pre>
<h4 id="&#x4F7F;&#x7528;">&#x4F7F;&#x7528;</h4>
<pre class="language-"><code class="lang-javascript"><span class="token keyword">const</span> <span class="token punctuation">{</span> label<span class="token punctuation">,</span> tips<span class="token punctuation">,</span> ok<span class="token punctuation">,</span> cancel <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$t</span><span class="token punctuation">(</span><span class="token string">&quot;app.signOut.confirm&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">$confirm</span><span class="token punctuation">(</span>label<span class="token punctuation">,</span> tips<span class="token punctuation">,</span> <span class="token punctuation">{</span>
    confirmButtonText<span class="token operator">:</span> ok<span class="token punctuation">,</span>
    cancelButtonText<span class="token operator">:</span> cancel<span class="token punctuation">,</span>
    type<span class="token operator">:</span> <span class="token string">&quot;warning&quot;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">then</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=&gt;</span> <span class="token punctuation">{</span>
    <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">logout</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<h4 id="&#x89C4;&#x8303;">&#x89C4;&#x8303;</h4>
<blockquote>
<p>&#x591A;&#x8BED;&#x8A00;&#x8BBE;&#x7F6E;&#x5C3D;&#x91CF;&#x6DFB;&#x52A0;&#x5907;&#x6CE8;&#xFF0C;&#x540E;&#x671F;&#x8FED;&#x4EE3;||&#x7EF4;&#x62A4;&#x6BD4;&#x8F83;&#x53CB;&#x597D;</p>
</blockquote>
<pre class="language-"><code class="lang-bash"><span class="token operator">&lt;</span><span class="token operator">!</span>-- &#x5168;&#x5C4F; --<span class="token operator">&gt;</span>
<span class="token operator">&lt;</span>el-tooltip :content<span class="token operator">=</span><span class="token string">&quot;<span class="token variable">$t</span>(&apos;app.screenFull&apos;)&quot;</span> <span class="token assign-left variable">effect</span><span class="token operator">=</span><span class="token string">&quot;dark&quot;</span> <span class="token assign-left variable">placement</span><span class="token operator">=</span><span class="token string">&quot;bottom&quot;</span><span class="token operator">&gt;</span>
    <span class="token operator">&lt;</span>screenfull <span class="token assign-left variable">class</span><span class="token operator">=</span><span class="token string">&quot;right-menu-item&quot;</span> /<span class="token operator">&gt;</span>
<span class="token operator">&lt;</span>/el-tooltip<span class="token operator">&gt;</span>
<span class="token operator">&lt;</span><span class="token operator">!</span>-- &#x5E03;&#x5C40;&#x5927;&#x5C0F; --<span class="token operator">&gt;</span>
<span class="token operator">&lt;</span>el-tooltip :content<span class="token operator">=</span><span class="token string">&quot;<span class="token variable">$t</span>(&apos;app.size&apos;)&quot;</span> <span class="token assign-left variable">effect</span><span class="token operator">=</span><span class="token string">&quot;dark&quot;</span> <span class="token assign-left variable">placement</span><span class="token operator">=</span><span class="token string">&quot;bottom&quot;</span><span class="token operator">&gt;</span>
    <span class="token operator">&lt;</span>size-select <span class="token assign-left variable">class</span><span class="token operator">=</span><span class="token string">&quot;right-menu-item&quot;</span> /<span class="token operator">&gt;</span>
<span class="token operator">&lt;</span>/el-tooltip<span class="token operator">&gt;</span>
<span class="token operator">&lt;</span><span class="token operator">!</span>-- &#x56FD;&#x9645;&#x5316; --<span class="token operator">&gt;</span>
<span class="token operator">&lt;</span>el-tooltip :content<span class="token operator">=</span><span class="token string">&quot;<span class="token variable">$t</span>(&apos;app.language&apos;)&quot;</span> <span class="token assign-left variable">effect</span><span class="token operator">=</span><span class="token string">&quot;dark&quot;</span> <span class="token assign-left variable">placement</span><span class="token operator">=</span><span class="token string">&quot;bottom&quot;</span><span class="token operator">&gt;</span>
    <span class="token operator">&lt;</span>lang-select <span class="token assign-left variable">class</span><span class="token operator">=</span><span class="token string">&quot;right-menu-item hover-effect&quot;</span> /<span class="token operator">&gt;</span>
<span class="token operator">&lt;</span>/el-tooltip<span class="token operator">&gt;</span>
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="Config.html" class="navigation navigation-prev " aria-label="Previous page: 环境变量">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Interceptor.html" class="navigation navigation-next " aria-label="Next page: 拦截器">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"国际化","level":"1.4","depth":1,"next":{"title":"拦截器","level":"1.5","depth":1,"path":"src/Interceptor.md","ref":"src/Interceptor.md","articles":[]},"previous":{"title":"环境变量","level":"1.3","depth":1,"path":"src/Config.md","ref":"src/Config.md","articles":[]},"dir":"ltr"},"config":{"plugins":["chapter-fold","-lunr","-search","search-pro","-highlight","prism","livereload"],"styles":{"website":"index.css"},"pluginsConfig":{"prism":{"css":["prismjs/themes/prism-tomorrow.css"]},"chapter-fold":{},"search-pro":{},"livereload":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Gj","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"classbro-u-center-web-v2.0","language":"zh-hans","gitbook":"3.2.3","description":"u-center-web 项目迁移 重构"},"file":{"path":"src/I18n.md","mtime":"2020-07-27T06:30:54.930Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-07-27T06:50:03.177Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

